import { getSeachArtResult,getSearch } from "@/api"
const state = {
    searchArts:[],
    searchCollections:[],
    searchUsers:[]
}

const mutations = {
    SEARCHARTS(context,data){
        context.searchArts = data
    },
    SEARCHCOLLECTIONS(context,data){
        context.searchCollections = data
    },
    SEARCHUSERS(context, data){
        context.searchUsers = data
    }

}

const actions = {
    async searchArts({commit},params){
        let result = await getSearch(params)
        commit("SEARCHARTS", result)
    },
    async searchCollections({commit},params){
        let result = await getSearch(params)
        commit("SEARCHCOLLECTIONS", result)
    },
    async searchUsers({commit}, params){
        let result = await getSearch(params)
        commit("SEARCHUSERS", result)
    }
}

const getters = {}

export default {
    state,
    mutations,
    actions,
    getters
}